package com.itheima.web;

import com.itheima.dto.LinechartDto;
import com.itheima.service.LinechartService;
import com.itheima.support.Result;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author YuanDao
 * @date 2021/3/26 20:40
 */
@RestController
@RequestMapping("/line")
public class LinechartController {
    @DubboReference
    private LinechartService linechartService;

    @GetMapping("/linechart/{startDate}/{closeDate}")
    public Result<LinechartDto> linechart(@PathVariable("startDate") String startDate, @PathVariable("closeDate") String closeDate) {
        return Result.build(linechartService.lineChat(startDate, closeDate));
    }

    @GetMapping("/selectReportSex")
    public Result<List<Map>> selectReportSex() {
        return Result.build(linechartService.selectReportSex());
    }

}
